#!/bin/bash

relase_localization_repo_dir=/home/nio/repos/localization/newest_feature_1/release/localization
relase_cosine_percpetion_repo_dir=/home/nio/repos/localization/newest_feature_1/release/cosine_perception



sudo docker run --rm -it -v /home/nio/repos/localization/newest_feature_1/release:/code adas-img.nioint.com/aa-sdk/cosine_orin_sud:v0.9.8














source_dir_root=/home/nio/repos/localization/newest_feature_1/release/localization/
target_dir_root=/home/nio/repos/localization/newest_feature_1/release/cosine_perception


# localization_module
rm -rf $target_dir_root/algso/include/localization_module/*
cp -rf $source_dir_root/src/cosine_ws/install/include/localization_module/* $target_dir_root/algso/include/localization_module/
ls -atl $target_dir_root/algso/include/localization_module/

rm -rf $target_dir_root/algso/lib/liblocalization_module.so
cp $source_dir_root/src/cosine_ws/install/lib/liblocalization_module.so $target_dir_root/algso/lib/
ls -atl $target_dir_root/algso/lib/liblocalization_module.so

# #map_module
# ## include_dir
# map_engine_external_dir_root=$source_dir_root/localization_external/opt/nio/aarch64/cosine
# map_module_source_inc_dir=$map_engine_external_dir_root/include/map_module
# map_module_target_inc_dir=$target_dir_root/algso/include/map_module
# map_module_source_lib_dir=$map_engine_external_dir_root/lib
# map_module_target_lib_dir=$target_dir_root/algso/lib
# echo "$map_engine_external_dir_root"
# if [ ! -d $map_module_target_inc_dir ]; then
#   mkdir -p $map_module_target_inc_dir
# else
#   rm -rf $map_module_target_inc_dir
# fi

# cp -r $map_module_source_inc_dir/* $map_module_target_inc_dir

# ls -atl $map_module_target_inc_dir

# rm -rf $map_module_target_lib_dir/libmap_module.so $map_module_target_lib_dir/libmap_proto.so $map_module_target_lib_dir/libnds_sqlite3_crypto.so $map_module_target_lib_dir/libnds_sqlite3.so

# cp $map_module_source_lib_dir/libmap_module.so         $map_module_target_lib_dir
# cp $map_module_source_lib_dir/libmap_proto.so          $map_module_target_lib_dir
# cp $map_module_source_lib_dir/libnds_sqlite3_crypto.so $map_module_target_lib_dir
# cp $map_module_source_lib_dir/libnds_sqlite3.so        $map_module_target_lib_dir
# ls -atl $target_dir_root/algso/lib